package org.pcorp.battlespace.construction.ui.onglets;

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;

import javax.swing.JPanel;

import org.pcorp.battlespace.construction.modele.VaisseauCstr;
import org.pcorp.battlespace.construction.ui.Principal;
import org.pcorp.battlespace.construction.ui.sub.SubInterfaceUi;
import org.pcorp.battlespace.construction.ui.sub.armement.ArmSelectUI;
import org.pcorp.battlespace.construction.ui.tools.ConstanteUI;

public class OngletArmementUi extends JPanel implements SubInterfaceUi {
	private static final long serialVersionUID = 3658339586354814436L;
	private Principal p;
	private ArmSelectUI armement ;
	
	public OngletArmementUi(Principal p) {
		this.p = p;
		setBackground(ConstanteUI.BACKGROUND_COLOR);
		setLayout(new GridBagLayout());
		GridBagConstraints gbc = new GridBagConstraints();
		
		gbc.gridx = gbc.gridy = 0;
	    gbc.gridwidth = gbc.gridheight = 1;
	    gbc.weightx = 1;
	    gbc.weighty = 1;
	    
	    gbc.anchor = GridBagConstraints.PAGE_START;
	    gbc.fill = GridBagConstraints.BOTH;
	    
	    armement = new ArmSelectUI(this.p);
	    add(armement, gbc);
	    
	  //  JPanel pVide = new JPanel();
	   // gbc.gridy = 1;
	   // gbc.anchor = GridBagConstraints.PAGE_END;
	   // gbc.weighty = 1; // permet de caler le composant en haut en lui attribuant toute la place restante dispo
	   // add(pVide, gbc);

	}


	@Override
	public void updateDisplay(VaisseauCstr vaiss) {
		armement.updateDisplay(vaiss);
	}

	@Override
	public void updateModel(VaisseauCstr vaiss) {
		armement.updateModel(vaiss);
	}
}
